package com.klhappy.houyuan.modle;

import android.content.Context;
import android.util.Log;

import com.klhappy.houyuan.constant.KeyConstant;
import com.klhappy.houyuan.constant.UrlConstant;
import com.klhappy.houyuan.utils.BaseModel;
import com.klhappy.houyuan.utils.ConfigManager;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by MrPu on 15/11/24.
 * 找回密码
 */
public class GetPassWordModle extends BaseModel {

    private Map<String ,String> params = new HashMap<>();

    private ConfigManager manage;

    private String session;

    public GetPassWordModle(Context context) {
        super(context);
        this.context = context;
        manage = new ConfigManager(context);
    }
    //保存新密码
    public void setPassWord(String phone, String own_pwd, String vercode){
        String path = UrlConstant.NEWPWD_URL;
        session = manage.get(KeyConstant.cookie ,session);
        params.put("phone", phone);
        params.put("vercode", vercode);
        params.put("own_pwd", own_pwd);
        Callback(path, params, session);
    }
    //注册账号
    public void setAccount(String account, String password, String registCode, String tuijianma){
        String path = UrlConstant.REGIST_URL;
        session = manage.get(KeyConstant.cookie ,session);
        params.put("own_mob_no", account);
        params.put("own_pwd", password);
        params.put("vercode", registCode);
        params.put("bind_inv_code", tuijianma);
        params.put("plat_type", "1");
        Callback(path ,params ,session);
    }
}
